* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* 动态背景效果 */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #c63f3f, #5930dc, #85ed2f, #f8eb7e);
    background-size: 400% 400%;
    opacity: 0.1;
    z-index: -1;
    animation: gradientBackground 15s ease infinite;
}

@keyframes gradientBackground {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    width: 100%;
    max-width: 500px;
    padding: 2rem;
}

.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #2c3e50;
    background: linear-gradient(45deg, #71bcf1, #2c3e50);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); }
    50% { text-shadow: 0 2px 12px rgba(52, 152, 219, 0.5); }
    100% { text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); }
}

.user-info-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.user-info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.05), rgba(231, 76, 60, 0.05));
    z-index: -1;
}

.user-info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.user-info {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.user-avatar-placeholder {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 1.5rem;
    background: #eee; /* 增加中性背景作为过渡 */
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.user-avatar-placeholder::before,
.user-avatar-placeholder::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: #000;
    animation: yinyang 4s ease-in-out infinite;
    border-radius: 50%;
}

.user-avatar-placeholder::after {
    background: #fff;
    animation-delay: -2s;
    box-shadow: inset 0 0 8px rgba(0,0,0,0.2);
}

@keyframes yinyang {
    0%, 100% {
        clip-path: circle(30% at 100% 50%);
        transform: rotate(0deg);
    }
    25% {
        clip-path: circle(35% at 50% 100%);
    }
    50% {
        clip-path: circle(30% at 0% 50%);
        transform: rotate(180deg);
    }
    75% {
        clip-path: circle(35% at 50% 0%);
    }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0px); }
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.stat-label {
    font-weight: 600;
    color: #7f8c8d;
}

.stat-value {
    font-weight: 700;
    color: #2c3e50;
    transition: color 0.3s ease;
}

.stat-value:hover {
    color: #3498db;
}

.match-status {
    margin-top: 1.5rem;
}

.match-button {
    width: 100%;
    padding: 0.8rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.match-button:active {
    transform: translateY(0);
}

/* 匹配模式下的动画效果 */
body.matching-mode .user-info-card {
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.5);
    animation: pulseCard 1.5s infinite;
}

@keyframes pulseCard {
    0% { box-shadow: 0 0 20px rgba(52, 152, 219, 0.5); }
    50% { box-shadow: 0 0 30px rgba(52, 152, 219, 0.8); }
    100% { box-shadow: 0 0 20px rgba(52, 152, 219, 0.5); }
}

/* 匹配成功的动画效果 */
.match-success-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(46, 204, 113, 0.8) 0%, rgba(46, 204, 113, 0) 70%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: successFade 1.5s forwards;
}

@keyframes successFade {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .user-info {
        flex-direction: column;
        text-align: center;
    }

    .user-avatar {
        margin-right: 0;
        margin-bottom: 1rem;
    }
}

/* 排行榜按钮样式 */
.leaderboard-button {
    position: fixed;
    right: 20px;
    bottom: 20px;
    padding: 12px 24px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
    z-index: 100;
}

.leaderboard-button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.4);
}

.leaderboard-button:active {
    transform: translateY(0);
}

/* 排行榜模态窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    padding: 25px;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    border: none;
    background: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #7f8c8d;
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: #e74c3c;
}

.modal-title {
    margin: 0 0 20px 0;
    text-align: center;
    color: #2c3e50;
    font-size: 1.5rem;
}

.leaderboard-list {
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 5px; /* 为滚动条留出空间 */
}

.leaderboard-item {
    display: flex;
    align-items: center;
    /*padding: 12px 15px;*/
    margin-bottom: 10px;
    border-radius: 8px;
    background: rgba(240, 240, 240, 0.5);
    transition: all 0.2s ease;
}

.leaderboard-item:hover {
    background: rgba(52, 152, 219, 0.1);
}

.leaderboard-rank {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #3498db;
    color: white;
    border-radius: 50%;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
}

.leaderboard-rank.top3 {
    background: #e74c3c;
}

.leaderboard-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #eee;
    margin-right: 15px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.leaderboard-info {
    flex-grow: 1;
    min-width: 0;
    margin-left: 15px;
}

.leaderboard-username {
    font-weight: 600;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.leaderboard-stats {
    display: flex;
    font-size: 0.85rem;
    color: #7f8c8d;
}

.leaderboard-score {
    margin-right: 15px;
}

.leaderboard-winrate {
    white-space: nowrap;
}

/* 自定义滚动条 */
.leaderboard-list::-webkit-scrollbar {
    width: 6px;
}

.leaderboard-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.leaderboard-list::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 3px;
}

.leaderboard-list::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}